package com.zone.vehicle.sdk.module.superapp.cloud;

import com.zone.sdk.common.http.base.BaseRequest;
import com.zone.sdk.common.http.base.BaseResponse;
import com.zone.vehicle.sdk.module.superapp.cloud.request.AppListRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.AppsDetailRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.AppsDownloadQueueRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.AppsDownloadRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.AppsSyncAbilityListRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.AppsUpdateListRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.AppsUploadRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.RecommendListRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.SyncStatusRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.request.UserRequest;
import com.zone.vehicle.sdk.module.superapp.cloud.response.AppListResponse;
import com.zone.vehicle.sdk.module.superapp.cloud.response.AppsDownloadQueueResponse;
import com.zone.vehicle.sdk.module.superapp.cloud.response.AppsSyncAbilityListResponse;
import com.zone.vehicle.sdk.module.superapp.cloud.response.AppsUpdateListResponse;
import com.zone.vehicle.sdk.module.superapp.cloud.response.RecommendListResponse;
import com.zone.vehicle.sdk.module.superapp.cloud.response.UserResponse;

import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Streaming;

public interface ISuperAppCloudService {

    /**
     * 应用列表查询
     * 查询应用列表及状态，包含已安装，未安装
     * @return
     */
    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("apps/list")
    Observable<BaseResponse<AppListResponse>> appList(@Body AppListRequest request);

    /**
     * 应用列表查询
     * 查询应用列表及状态，包含已安装，未安装
     * @return
     */
    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("sync/status")
    Observable<BaseResponse<AppListResponse>> syncStatus(@Body SyncStatusRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("apps/updateList")
    Observable<BaseResponse<AppsUpdateListResponse>> appsUpdateList(@Body AppsUpdateListRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("recommend/list")
    Observable<BaseResponse<RecommendListResponse>> recommendList(@Body RecommendListRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("apps/detail")
    Observable<BaseResponse<AppsUpdateListResponse>> appsDetail(@Body AppsDetailRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("user/{id}")
    Observable<BaseResponse<UserResponse>> user(@Body UserRequest request);

    /**
     * 下载文件用
     * @param request
     * @return
     */
    @Streaming //添加这个注解用来下载大文件
    @POST("apps/download")
    Observable<ResponseBody> appsDownload(@Body AppsDownloadRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("apps/syncAbilityList")
    Observable<BaseResponse<AppsSyncAbilityListResponse>> appsSyncAbilityList(@Body AppsSyncAbilityListRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("apps/downloadQueue")
    Observable<BaseResponse<AppsDownloadQueueResponse>> appsDownloadQueue(@Body AppsDownloadQueueRequest request);

    @Multipart
    @POST("apps/upload")
    Observable<BaseResponse<BaseResponse>> appsUpload(@Body AppsUploadRequest request);
//    Observable<BaseResponse<AppsUpdateListResponse>> appsUpload(@Body AppsUploadRequest request, @Part MultipartBody.Part file);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("index/search")
    Observable<BaseResponse<BaseResponse>> indexSearch(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("comment/editComment")
    Observable<BaseResponse<BaseResponse>> commentEditComment(@Body BaseRequest request);


    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("comment/editReply")
    Observable<BaseResponse<BaseResponse>> commentEditReply(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("comment/commentPraise")
    Observable<BaseResponse<BaseResponse>> commentCommentPraise(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("comment/initCommentDetail")
    Observable<BaseResponse<BaseResponse>> commentInitCommentDetail(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("comment/updateComment")
    Observable<BaseResponse<BaseResponse>> commentUpdateComment(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("comment/commentScore")
    Observable<BaseResponse<BaseResponse>> commentCommentScore(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("comment/commentList")
    Observable<BaseResponse<BaseResponse>> commentCommentList(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("comment/commentDetail")
    Observable<BaseResponse<BaseResponse>> commentCommentDetail(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("comment/initAmwayWallList")
    Observable<BaseResponse<BaseResponse>> commentInitAmwayWallList(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("comment/userCommentList")
    Observable<BaseResponse<BaseResponse>> commentUserCommentList(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("comment/delUserComment")
    Observable<BaseResponse<BaseResponse>> commentDelUserComment(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("comment/searchCommentCount")
    Observable<BaseResponse<BaseResponse>> commentSearchCommentCount(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("feedback/feedbackCommit")
    Observable<BaseResponse<BaseResponse>> feedbackFeedbackCommit(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("user/captchacert/exchange/v1")
    Observable<BaseResponse<BaseResponse>> captchacertExchange(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("user/login/phonecode/v1")
    Observable<BaseResponse<BaseResponse>> loginPhoneCode(@Body BaseRequest request);


    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("user/login/phonepwd/v1")
    Observable<BaseResponse<BaseResponse>> loginPhonePwd(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("user/passwd/modified/v1")
    Observable<BaseResponse<BaseResponse>> userPwdModify(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @GET("user/info/v1")
    Observable<BaseResponse<BaseResponse>> queryUserInfo(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("user/info/v1")
    Observable<BaseResponse<BaseResponse>> updateUserInfo(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("user/logout/v1")
    Observable<BaseResponse<BaseResponse>> logout(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("user/refreshtoken/v1")
    Observable<BaseResponse<BaseResponse>> refreshToken(@Body BaseRequest request);

    @Multipart
    @POST("file/upload/v1")
    Observable<BaseResponse<BaseResponse>> userUpload(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @GET("user/login/status/v1")
    Observable<BaseResponse<BaseResponse>> loginStatus(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @GET("user/qrlogin/generate/v1")
    Observable<BaseResponse<BaseResponse>> qrLoginCode(@Body BaseRequest request);

    @Headers({"Content-Type: application/json;charset=utf-8",
            "Accept: application/json;charset=utf-8"})
    @POST("user/qrlogin/polling/v1")
    Observable<BaseResponse<BaseResponse>> qrLoginCodeStatus(@Body BaseRequest request);

}
